import React from 'react'
import axios from 'axios'
import {useEffect,useState} from "react"
function Detail(props) {
    let [obj,setObj] = useState({})
    useEffect(()=>{
        axios.get("/list1").then(res=>{
            console.log(res.data.list);
            let arr =  res.data.list.filter((item,index)=>{
                return item.id == props.match.params.id
            })
            console.log(arr);
            setObj(arr[0])
           
          })
    },[])
   console.log(props.match.params.id)
   console.log(obj,111)
   console.log("render")
  return (
    <div>
        {
            obj && <div>{obj.tit}</div>
        }
    </div>
  )
}

export default Detail